<%--
  Created by IntelliJ IDEA.
  User: 14122
  Date: 2022/8/18
  Time: 20:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/pintuer.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/admin.css">
    <script src="${pageContext.request.contextPath}/js/jquery.js"></script>
    <script src="/${pageContext.request.contextPath}js/pintuer.js"></script>
</head>
<body>

<li>

    <form action="${pageContext.request.contextPath}/employee/findEmployeeByName" method="post">
        <input type="text" name="username" value="">
        <input type="submit" value="查找">
    </form>
</li>


<table class="table table-hover text-center">
    <tr>
        <th width="120">员工编码</th>
        <th>员工姓名</th>
        <th>用户名</th>
        <th>职位ID</th>
        <th>员工职位</th>
    </tr>



        <c:forEach items="${jobList}" var="employee">
            <c:if test="${employee.jobList != null }"  >
                <tr>
                    <th>${employee.empId}</th>
                    <th>${employee.name}</th>
                    <th>${employee.userName}</th>
                    <th>
                        <c:forEach items="${employee.jobList}" var="job">
                            ${job.jobId}
                        </c:forEach>
                    </th>
                    <th>
                        <c:forEach items="${employee.jobList}" var="job">
                            ${job.job}
                        </c:forEach>
                    </th>
                    <td><a type="button" class="button border-main" href="${pageContext.request.contextPath}/employee/changeEmployeeJob?emp_id=${employee.empId}"><span class="icon-edit"></span>职位修改</a>
                        <a class="button border-red" href="${pageContext.request.contextPath}/employee/deleteEmployee?emp_id=${employee.empId}" onclick="return del(17)"><span class="icon-trash-o"></span>删除员工</a></td>
                </tr>

            </c:if>

        </c:forEach>

</table>


</form>
<script type="text/javascript">

    function del(id) {
        if (confirm("您确定要删除吗?")) {

        }
    }

    $("#checkall").click(function () {
        $("input[name='id[]']").each(function () {
            if (this.checked) {
                this.checked = false;
            } else {
                this.checked = true;
            }
        });
    })

    function DelSelect() {
        var Checkbox = false;
        $("input[name='id[]']").each(function () {
            if (this.checked == true) {
                Checkbox = true;
            }
        });
        if (Checkbox) {
            var t = confirm("您确认要删除选中的内容吗？");
            if (t == false) return false;
        } else {
            alert("请选择您要删除的内容!");
            return false;
        }
    }

</script>
</body>
</html>
